import React from 'react'
import { Redirect } from "react-router-dom"

// import LJDiscover from "pages/discover"
// import LJMine from 'pages/mine'
// import LJFirend from "pages/friends"
// import LJRecommend from '../pages/discover/c-pages/recommend';
// import LJRanking from "../pages/discover/c-pages/ranking";
// import LJSongs from "../pages/discover/c-pages/songs";
// import LJDjradio from "../pages/discover/c-pages/djradio";
// import LJArtist from "../pages/discover/c-pages/artist";
// import LJAlbum from "../pages/discover/c-pages/album";
// import LJPlayer from '../pages/player'

const LJDiscover = React.lazy(_ => import("../pages/discover"));
const LJMine = React.lazy(_ => import("../pages/mine"));
const LJFirend = React.lazy(_ => import("../pages/friends"));
const LJRecommend = React.lazy(_ => import("../pages/discover/c-pages/recommend"));
const LJRanking = React.lazy(_ => import("../pages/discover/c-pages/ranking"));
const LJSongs = React.lazy(_ => import("../pages/discover/c-pages/songs"));
const LJDjradio = React.lazy(_ => import("../pages/discover/c-pages/djradio"));
const LJArtist = React.lazy(_ => import("../pages/discover/c-pages/artist"));
const LJAlbum = React.lazy(_ => import("../pages/discover/c-pages/album"));
const LJPlayer = React.lazy(_ => import("../pages/player"));

const routes = [
    {
        path: "/",
        exact: true,
        render: () => (
            <Redirect to="/discover"/>
        )
    },
    {
        path: "/discover",
        component: LJDiscover,
        routes: [
            {
                path: "/discover",
                exact: true,
                render: () => (
                    <Redirect to="/discover/recommend"/>
                )
            },
            {
                path: "/discover/recommend",
                component: LJRecommend
            },
            {
                path: "/discover/ranking",
                component: LJRanking
            },
            {
                path: "/discover/songs",
                component: LJSongs
            },
            {
                path: "/discover/djradio",
                component: LJDjradio
            },
            {
                path: "/discover/artist",
                component: LJArtist
            },
            {
                path: "/discover/album",
                component: LJAlbum
            },
            {
                path: "/discover/player",
                component: LJPlayer
            }
        ],
    },
    {
        path: "/mine",
        component: LJMine,
    },
    {
        path: "/friends",
        component: LJFirend,
    },
]

export default routes